import axios from "axios";

export default {
  namespaced: true,
  state: {
    cinema: {},
  },
  mutations: {
    getCinemaList(state, cinema) {
      state.cinema = cinema
    },
  },
  actions: {
    async getCinema({commit}, id) {
      await axios({
        url: `http://localhost:3000/cinema/${id}`
      }).then(res => {
        commit('getCinemaList', JSON.parse(res.data.cinema).data)
      })
    }
  }
}